package com.itheima.d2_Collection_Set;

import java.util.HashSet;
import java.util.Set;

/**
 * 使用Set来去重
 */
public class demo2 {
    public static void main(String[] args) {
        Student s1 = new Student("甘雨",18,"女");
        Student s2 = new Student("甘雨",18,"女");
        Student s3 = new Student("刻晴",19,"女");
        Set<Student> sets = new HashSet<>();//重写hashCode

        sets.add(s1);
        sets.add(s2);
        sets.add(s3);
        System.out.println(sets);
    }
}
